import request from "@/utils/request.js";

// 获取课本列表
export function listWordBook(data) {
	return request({
		url: '/book/getBookList',
		method: 'post',
		data,
	})
}

// 获取词表 查看词表
export function wordByBook(data) {
	return request({
		url: '/book/getWordByBook',
		method: 'post',
		data
	})
}

// 修改用户课本
export function userWordBookEdit(bookId, status) {
	return request({
		url: `/book/user?bookId=${bookId}&status=${status}`,
		method: 'put',
	})
}

// 获取用户课本
export function userWordBookInfo() {
	return request({
		url: '/book/user',
		method: 'get',
	})
}


// 进入课本
export function userTextWordBook(bookId) {
	return request({
		url: '/book/book/' + bookId,
		method: 'get',
	})
}

// 获取用户课本和计划
export function bookAndPlan() {
	return request({
		url: '/book/getBookAndPlan',
		method: 'get',
	})
}

// 获取用户课本和计划的所有单词
export function bookAndPlanWords(data) {
	return request({
		url: '/book/getBookAndPlanWords',
		method: 'post',
		data
	})
}


// 获取词表 查看词表
export function wordListByBookId(bookId,page,size) {
	return request({
		url: `/library/getwordslist/${bookId}?page=${page}&size=${size}`,
		method: 'post'
	})
}